﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Libs.Partner;

public partial class Pages_Partners_Mobile_Partner_Detail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Title = Title + " - Thông tin đối tác";
        init();
    }

    private void init()
    {
        // init
        var _Partner = new Partner() { PartnerID = AppUtils.Request("id") };
        _Partner = _Partner.Get();
        if (_Partner == null) Response.Redirect(Constant.ADMIN_PATH + Resources.Url.MobilePartner);

        txtFullName.Text = _Partner.FullName;
        txtPosition.Text = _Partner.Position;
        txtEmail.Text = _Partner.Email;
        txtFax.Text = _Partner.Fax;
        txtMobile.Text = _Partner.Mobile;
        txtWorkPhone.Text = _Partner.WorkPhone;
        txtHomePhone.Text = _Partner.HomePhone;
        txtHomeAddress.Text = _Partner.HomeAddress;
        txtWorkAddress.Text = _Partner.WorkAddress;
        txtWebsite.Text = _Partner.Website;

        if (_Partner.Birthday != DateTime.MinValue)
        {
            txtBirthday.Text = _Partner.Birthday.ToString("dd/MM/yyyy");
        }

        // 
        var _Company = new Company() { CompanyID = _Partner.CompanyID };
        _Company = _Company.Get();
        lblCompany.Text = _Company.Name;
    }
}